package com.aiwu.pop;

import android.os.Bundle;
import android.view.View;
import android.widget.CheckBox;

import androidx.appcompat.app.AlertDialog;

import com.aiwu.library.AiwuSimulator;

import org.citra.citra_emu.R;
import org.citra.citra_emu.activities.EmulationActivity;
import org.citra.citra_emu.features.settings.model.Settings;
import org.citra.citra_emu.features.settings.ui.SettingsActivity;
import org.citra.citra_emu.utils.EmulationMenuSettings;

/**
 * 控制设置
 */
public class ConfigureControlsDialog extends AlertDialog implements View.OnClickListener {
    private EmulationActivity activity;
    private FastSettingDialog fastSettingDialog;

    public ConfigureControlsDialog(EmulationActivity context,FastSettingDialog fastSettingDialog) {
        super(context, R.style.AiWuDialog);
        this.activity = context;
        this.fastSettingDialog = fastSettingDialog;
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        init();
    }

    private void init() {
        setContentView(R.layout.dialog_configure_controls);
        setCancelable(true);
        setCanceledOnTouchOutside(true);
        initView();
    }

    private void initView() {
        findViewById(R.id.layout_operate).setOnClickListener(this);
        findViewById(R.id.layout_handle).setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.layout_operate:
                AiwuSimulator.showConfigListPop();
                break;
            case R.id.layout_handle:
                AiwuSimulator.showHandleConfigListPop();
                break;
        }
        dismiss();
        fastSettingDialog.dismiss();
    }
}
